package lihao;

import java.util.Arrays;

public class Test08 {

    public static void main(String[] args) {

        float[] scores = new float[] { 10f, 9f, 8f, 7f, 6f, 5f, 4f, 3f, 2f, 1f };

        float max = Float.MIN_VALUE;

        for(float score : scores) {
            if (score > max) {
                max = score;
            }
        }

        System.out.println("最高分：" + max);

        float min = Float.MAX_VALUE;

        for(float score : scores) {
            if (score < min) {
                min = score;
            }
        }

        System.out.println("最低分：" + min);

        float sum = 0;

        for(float score : scores) {
            sum += score;
        }

        float average = sum / scores.length;


        System.out.println("平均分：" + average);

        // 从小到大排序
        Arrays.sort(scores);
        System.out.println("从小到大分数排序：");
        for(float score : scores) {
            System.out.print(score + " ");
        }
    }

}